{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "2eb7ac2d",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['70.19', '72.50', '72.70', '70.68', '74.10', '72.63', '69.25', '72.27']\n",
      "['71.50', '71.50', '71.50', '71.50', '71.50', '71.50', '71.50', '71.50']\n"
     ]
    }
   ],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "import ast\n",
    "import re\n",
    "import matplotlib.pyplot as plt\n",
    "list_a=np.arange(11)\n",
    "p1=pd.read_csv(\"18-19train_update.csv\",low_memory=False,usecols=list_a)\n",
    "category_total=[]\n",
    "# category_total.append(\"通信工程\")\n",
    "# category_total.append(\"计算机科学与技术\")\n",
    "# category_total.append(\"电信工程及管理\")\n",
    "# category_total.append(\"信息工程\")\n",
    "# category_total.append(\"电子商务及法律\")\n",
    "# category_total.append(\"物联网工程\")\n",
    "# category_total.append(\"软件工程\")\n",
    "# category_total.append(\"电子科学与技术\")\n",
    "category_total.append(\"通信工程\")\n",
    "category_total.append(\"计算机科学\")\n",
    "category_total.append(\"电信工程\")\n",
    "category_total.append(\"信息工程\")\n",
    "category_total.append(\"电子商务\")\n",
    "category_total.append(\"物联网工程\")\n",
    "category_total.append(\"软件工程\")\n",
    "category_total.append(\"电子科学\")\n",
    "#通信工程\n",
    "commu_engin=[]\n",
    "#计算机科学与技术\n",
    "computer_science=[]\n",
    "#电信工程与管理\n",
    "telecommu_engin_manage=[]\n",
    "#信息工程\n",
    "message_engin=[]\n",
    "#电子商务及法律\n",
    "tele_commerce_legal=[]\n",
    "#物联网工程\n",
    "product_online=[]\n",
    "#软件工程\n",
    "software_engin=[]\n",
    "#电子科学与技术\n",
    "tele_science=[]\n",
    "#所有类别\n",
    "all_category=[]\n",
    "for i in range(0,6906):\n",
    "    if p1[\"2018-体测\"][i]>0:\n",
    "        all_category.append(p1[\"2018-体测\"][i])\n",
    "        if p1[\"现在专业\"][i]==\"['通信工程']\":\n",
    "            commu_engin.append(p1[\"2018-体测\"][i])\n",
    "        if p1[\"现在专业\"][i]==\"['计算机科学与技术']\":\n",
    "            computer_science.append(p1[\"2018-体测\"][i])\n",
    "        if p1[\"现在专业\"][i]==\"['电信工程及管理']\":\n",
    "            telecommu_engin_manage.append(p1[\"2018-体测\"][i])\n",
    "        if p1[\"现在专业\"][i]==\"['信息工程']\":\n",
    "            message_engin.append(p1[\"2018-体测\"][i])\n",
    "        if p1[\"现在专业\"][i]==\"['电子商务及法律']\":\n",
    "            tele_commerce_legal.append(p1[\"2018-体测\"][i])\n",
    "        if p1[\"现在专业\"][i]==\"['物联网工程']\":\n",
    "            product_online.append(p1[\"2018-体测\"][i])\n",
    "        if p1[\"现在专业\"][i]==\"['软件工程']\":\n",
    "            software_engin.append(p1[\"2018-体测\"][i])\n",
    "        if p1[\"现在专业\"][i]==\"['电子科学与技术']\":\n",
    "            tele_science.append(p1[\"2018-体测\"][i])  \n",
    "\n",
    "pe_1='{:.2f}'.format(np.mean(commu_engin))\n",
    "pe_2='{:.2f}'.format(np.mean(computer_science))\n",
    "pe_3='{:.2f}'.format(np.mean(telecommu_engin_manage))\n",
    "pe_4='{:.2f}'.format(np.mean(message_engin))\n",
    "pe_5='{:.2f}'.format(np.mean(tele_commerce_legal))\n",
    "pe_6='{:.2f}'.format(np.mean(product_online))\n",
    "pe_7='{:.2f}'.format(np.mean(software_engin))\n",
    "pe_8='{:.2f}'.format(np.mean(tele_science))\n",
    "pe_all='{:.2f}'.format(np.mean(all_category))\n",
    "averge_pe=[pe_1,pe_2,pe_3,pe_4,pe_5,pe_6,pe_7,pe_8]\n",
    "print(averge_pe)\n",
    "all_category_pe=[pe_all,pe_all,pe_all,pe_all,pe_all,pe_all,pe_all,pe_all]\n",
    "print(all_category_pe)\n",
    "# print(len(commu_engin))\n",
    "# print(len(tele_science))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "3152c445",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['70.03', '71.17', '71.39', '72.30', '73.53', '71.63', '69.16', '71.27']\n",
      "['71.16', '71.16', '71.16', '71.16', '71.16', '71.16', '71.16', '71.16']\n"
     ]
    }
   ],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "import ast\n",
    "import re\n",
    "import matplotlib.pyplot as plt\n",
    "list_a=np.arange(11)\n",
    "p2=pd.read_csv(\"19-20train_update.csv\",low_memory=False,usecols=list_a)\n",
    "category_total1=[]\n",
    "# category_total.append(\"通信工程\")\n",
    "# category_total.append(\"计算机科学与技术\")\n",
    "# category_total.append(\"电信工程及管理\")\n",
    "# category_total.append(\"信息工程\")\n",
    "# category_total.append(\"电子商务及法律\")\n",
    "# category_total.append(\"物联网工程\")\n",
    "# category_total.append(\"软件工程\")\n",
    "# category_total.append(\"电子科学与技术\")\n",
    "category_total1.append(\"通信工程\")\n",
    "category_total1.append(\"计算机科学\")\n",
    "category_total1.append(\"电信工程\")\n",
    "category_total1.append(\"信息工程\")\n",
    "category_total1.append(\"电子商务\")\n",
    "category_total1.append(\"物联网工程\")\n",
    "category_total1.append(\"软件工程\")\n",
    "category_total1.append(\"电子科学\")\n",
    "#通信工程\n",
    "commu_engin2=[]\n",
    "#计算机科学与技术\n",
    "computer_science2=[]\n",
    "#电信工程与管理\n",
    "telecommu_engin_manage2=[]\n",
    "#信息工程\n",
    "message_engin2=[]\n",
    "#电子商务及法律\n",
    "tele_commerce_legal2=[]\n",
    "#物联网工程\n",
    "product_online2=[]\n",
    "#软件工程\n",
    "software_engin2=[]\n",
    "#电子科学与技术\n",
    "tele_science2=[]\n",
    "#所有类别\n",
    "all_category2=[]\n",
    "for i in range(0,6906):\n",
    "    if p2[\"2019-体测\"][i]>0:\n",
    "        all_category2.append(p2[\"2019-体测\"][i])\n",
    "        if p2[\"现在专业\"][i]==\"['通信工程']\":\n",
    "            commu_engin2.append(p2[\"2019-体测\"][i])\n",
    "        if p2[\"现在专业\"][i]==\"['计算机科学与技术']\":\n",
    "            computer_science2.append(p2[\"2019-体测\"][i])\n",
    "        if p2[\"现在专业\"][i]==\"['电信工程及管理']\":\n",
    "            telecommu_engin_manage2.append(p2[\"2019-体测\"][i])\n",
    "        if p2[\"现在专业\"][i]==\"['信息工程']\":\n",
    "            message_engin2.append(p2[\"2019-体测\"][i])\n",
    "        if p2[\"现在专业\"][i]==\"['电子商务及法律']\":\n",
    "            tele_commerce_legal2.append(p2[\"2019-体测\"][i])\n",
    "        if p2[\"现在专业\"][i]==\"['物联网工程']\":\n",
    "            product_online2.append(p2[\"2019-体测\"][i])\n",
    "        if p2[\"现在专业\"][i]==\"['软件工程']\":\n",
    "            software_engin2.append(p2[\"2019-体测\"][i])\n",
    "        if p2[\"现在专业\"][i]==\"['电子科学与技术']\":\n",
    "            tele_science2.append(p2[\"2019-体测\"][i])  \n",
    "\n",
    "pe_2_1='{:.2f}'.format(np.mean(commu_engin2))\n",
    "pe_2_2='{:.2f}'.format(np.mean(computer_science2))\n",
    "pe_2_3='{:.2f}'.format(np.mean(telecommu_engin_manage2))\n",
    "pe_2_4='{:.2f}'.format(np.mean(message_engin2))\n",
    "pe_2_5='{:.2f}'.format(np.mean(tele_commerce_legal2))\n",
    "pe_2_6='{:.2f}'.format(np.mean(product_online2))\n",
    "pe_2_7='{:.2f}'.format(np.mean(software_engin2))\n",
    "pe_2_8='{:.2f}'.format(np.mean(tele_science2))\n",
    "pe_2_all='{:.2f}'.format(np.mean(all_category2))\n",
    "averge_pe2=[pe_2_1,pe_2_2,pe_2_3,pe_2_4,pe_2_5,pe_2_6,pe_2_7,pe_2_8]\n",
    "print(averge_pe2)\n",
    "all_category_pe2=[pe_2_all,pe_2_all,pe_2_all,pe_2_all,pe_2_all,pe_2_all,pe_2_all,pe_2_all]\n",
    "print(all_category_pe2)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "21368fa3",
   "metadata": {},
   "outputs": [],
   "source": [
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Bar"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "ac668416",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'E:\\\\挑战杯python代码\\\\pe_test.html'"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts.render import make_snapshot\n",
    "from snapshot_selenium import snapshot\n",
    "bar=(\n",
    "    Bar()\n",
    "    .add_xaxis(category_total)\n",
    "    .add_yaxis(\"18-19各专业平均成绩\",averge_pe)\n",
    "    .add_yaxis(\"18-19总平均成绩\",all_category_pe)\n",
    "    .add_yaxis(\"19-20各专业平均成绩\",averge_pe2)\n",
    "    .add_yaxis(\"19-20总平均成绩\",all_category_pe2)\n",
    "    .set_global_opts(title_opts=opts.TitleOpts(title=\"体测成绩对比图\"),yaxis_opts=opts.AxisOpts(\n",
    "\t                min_='66')\n",
    "                    )\n",
    ")\n",
    "bar.render_notebook()\n",
    "bar.render('pe_test.html')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "3bf4c52a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "import ast\n",
    "import re\n",
    "import matplotlib.pyplot as plt\n",
    "list_a=np.arange(11)\n",
    "p1=pd.read_csv(\"18-19train_update.csv\",low_memory=False,usecols=list_a)\n",
    "p1[\"现在专业\"][0]==\"['物联网工程']\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "2ba53c01",
   "metadata": {},
   "outputs": [],
   "source": [
    "#分专业图书阅读情况分布图\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "import ast\n",
    "import re\n",
    "import matplotlib.pyplot as plt\n",
    "list_a=np.arange(11)\n",
    "p1=pd.read_csv(\"18-19train_update.csv\",low_memory=False,usecols=list_a)\n",
    "category_total=[]\n",
    "# category_total.append(\"通信工程\")\n",
    "# category_total.append(\"计算机科学与技术\")\n",
    "# category_total.append(\"电信工程及管理\")\n",
    "# category_total.append(\"信息工程\")\n",
    "# category_total.append(\"电子商务及法律\")\n",
    "# category_total.append(\"物联网工程\")\n",
    "# category_total.append(\"软件工程\")\n",
    "# category_total.append(\"电子科学与技术\")\n",
    "category_total.append(\"通信工程\")\n",
    "category_total.append(\"计算机科学\")\n",
    "category_total.append(\"电信工程\")\n",
    "category_total.append(\"信息工程\")\n",
    "category_total.append(\"电子商务\")\n",
    "category_total.append(\"物联网工程\")\n",
    "category_total.append(\"软件工程\")\n",
    "category_total.append(\"电子科学\")\n",
    "#通信工程\n",
    "commu_engin_get=[]\n",
    "commu_engin_no=[]\n",
    "commu_engin_total=[]\n",
    "#计算机科学与技术\n",
    "computer_science_get=[]\n",
    "computer_science_no=[]\n",
    "computer_science_total=[]\n",
    "#电信工程与管理\n",
    "telecommu_engin_manage_get=[]\n",
    "telecommu_engin_manage_no=[]\n",
    "telecommu_engin_manage_total=[]\n",
    "#信息工程\n",
    "message_engin_get=[]\n",
    "message_engin_no=[]\n",
    "message_engin_total=[]\n",
    "#电子商务及法律\n",
    "tele_commerce_legal_get=[]\n",
    "tele_commerce_legal_no=[]\n",
    "tele_commerce_legal_total=[]\n",
    "#物联网工程\n",
    "product_online_get=[]\n",
    "product_online_no=[]\n",
    "product_online_total=[]\n",
    "#软件工程\n",
    "software_engin_get=[]\n",
    "software_engin_no=[]\n",
    "software_engin_total=[]\n",
    "#电子科学与技术\n",
    "tele_science_get=[]\n",
    "tele_science_no=[]\n",
    "tele_science_total=[]\n",
    "#所有类别\n",
    "all_category=[]\n",
    "for i in range(0,6906):\n",
    "        all_category.append(p1[\"阅读情况\"][i])\n",
    "        if p1[\"现在专业\"][i]==\"['通信工程']\":\n",
    "            commu_engin_total.append(p1[\"阅读情况\"][i])\n",
    "            if p1[\"类型\"][i]==\"无\":\n",
    "                commu_engin_no.append(p1[\"阅读情况\"][i])\n",
    "            else:\n",
    "                commu_engin_get.append(p1[\"阅读情况\"][i])\n",
    "        if p1[\"现在专业\"][i]==\"['计算机科学与技术']\":\n",
    "            computer_science_total.append(p1[\"阅读情况\"][i])\n",
    "            if p1[\"类型\"][i]==\"无\":\n",
    "                computer_science_no.append(p1[\"阅读情况\"][i])\n",
    "            else:\n",
    "                computer_science_get.append(p1[\"阅读情况\"][i])\n",
    "        if p1[\"现在专业\"][i]==\"['电信工程及管理']\":\n",
    "            telecommu_engin_manage_total.append(p1[\"阅读情况\"][i])\n",
    "            if p1[\"类型\"][i]==\"无\":\n",
    "                telecommu_engin_manage_no.append(p1[\"阅读情况\"][i])\n",
    "            else:\n",
    "                telecommu_engin_manage_get.append(p1[\"阅读情况\"][i])\n",
    "        if p1[\"现在专业\"][i]==\"['信息工程']\":\n",
    "            message_engin_total.append(p1[\"阅读情况\"][i])\n",
    "            if p1[\"类型\"][i]==\"无\":\n",
    "                message_engin_no.append(p1[\"阅读情况\"][i])\n",
    "            else:\n",
    "                message_engin_get.append(p1[\"阅读情况\"][i])\n",
    "        if p1[\"现在专业\"][i]==\"['电子商务及法律']\":\n",
    "            tele_commerce_legal_total.append(p1[\"阅读情况\"][i])\n",
    "            if p1[\"类型\"][i]==\"无\":\n",
    "                tele_commerce_legal_no.append(p1[\"阅读情况\"][i])\n",
    "            else:\n",
    "                tele_commerce_legal_get.append(p1[\"阅读情况\"][i])\n",
    "        if p1[\"现在专业\"][i]==\"['物联网工程']\":\n",
    "            product_online_total.append(p1[\"阅读情况\"][i])\n",
    "            if p1[\"类型\"][i]==\"无\":\n",
    "                product_online_no.append(p1[\"阅读情况\"][i])\n",
    "            else:\n",
    "                product_online_get.append(p1[\"阅读情况\"][i])\n",
    "        if p1[\"现在专业\"][i]==\"['软件工程']\":\n",
    "            software_engin_total.append(p1[\"阅读情况\"][i])\n",
    "            if p1[\"类型\"][i]==\"无\":\n",
    "                software_engin_no.append(p1[\"阅读情况\"][i])\n",
    "            else:\n",
    "                software_engin_get.append(p1[\"阅读情况\"][i])\n",
    "        if p1[\"现在专业\"][i]==\"['电子科学与技术']\":\n",
    "            tele_science_total.append(p1[\"阅读情况\"][i])  \n",
    "            if p1[\"类型\"][i]==\"无\":\n",
    "                tele_science_no.append(p1[\"阅读情况\"][i])\n",
    "            else:\n",
    "                tele_science_get.append(p1[\"阅读情况\"][i])\n",
    "\n",
    "pe_1_total='{:.2f}'.format(np.mean(commu_engin_total))\n",
    "pe_1_no='{:.2f}'.format(np.mean(commu_engin_no))\n",
    "pe_1_get='{:.2f}'.format(np.mean(commu_engin_get))\n",
    "\n",
    "pe_2_total='{:.2f}'.format(np.mean(computer_science_total))\n",
    "pe_2_no='{:.2f}'.format(np.mean(computer_science_no))\n",
    "pe_2_get='{:.2f}'.format(np.mean(computer_science_get))\n",
    "\n",
    "pe_3_total='{:.2f}'.format(np.mean(telecommu_engin_manage_total))\n",
    "pe_3_no='{:.2f}'.format(np.mean(telecommu_engin_manage_no))\n",
    "pe_3_get='{:.2f}'.format(np.mean(telecommu_engin_manage_get))\n",
    "\n",
    "pe_4_total='{:.2f}'.format(np.mean(message_engin_total))\n",
    "pe_4_no='{:.2f}'.format(np.mean(message_engin_no))\n",
    "pe_4_get='{:.2f}'.format(np.mean(message_engin_get))\n",
    "\n",
    "pe_5_total='{:.2f}'.format(np.mean(tele_commerce_legal_total))\n",
    "pe_5_no='{:.2f}'.format(np.mean(tele_commerce_legal_no))\n",
    "pe_5_get='{:.2f}'.format(np.mean(tele_commerce_legal_get))\n",
    "\n",
    "pe_6_total='{:.2f}'.format(np.mean(product_online_total))\n",
    "pe_6_no='{:.2f}'.format(np.mean(product_online_no))\n",
    "pe_6_get='{:.2f}'.format(np.mean(product_online_get))\n",
    "\n",
    "pe_7_total='{:.2f}'.format(np.mean(software_engin_total))\n",
    "pe_7_no='{:.2f}'.format(np.mean(software_engin_no))\n",
    "pe_7_get='{:.2f}'.format(np.mean(software_engin_get))\n",
    "\n",
    "pe_8_total='{:.2f}'.format(np.mean(tele_science_total))\n",
    "pe_8_no='{:.2f}'.format(np.mean(tele_science_no))\n",
    "pe_8_get='{:.2f}'.format(np.mean(tele_science_get))\n",
    "pe_all='{:.2f}'.format(np.mean(all_category))\n",
    "averge_pe_total=[pe_1_total,pe_2_total,pe_3_total,pe_4_total,pe_5_total,pe_6_total,pe_7_total,pe_8_total]\n",
    "averge_pe_no=[pe_1_no,pe_2_no,pe_3_no,pe_4_no,pe_5_no,pe_6_no,pe_7_no,pe_8_no]\n",
    "averge_pe_get=[pe_1_get,pe_2_get,pe_3_get,pe_4_get,pe_5_get,pe_6_get,pe_7_get,pe_8_get]\n",
    "# print(averge_pe)\n",
    "all_category_pe=[pe_all,pe_all,pe_all,pe_all,pe_all,pe_all,pe_all,pe_all]\n",
    "\n",
    "# print(all_category_pe)\n",
    "# print(len(commu_engin))\n",
    "# print(len(tele_science))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "48b2f82a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"44e7dceb49b14a2bb280fda11c3ade33\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_44e7dceb49b14a2bb280fda11c3ade33 = echarts.init(\n",
       "                    document.getElementById('44e7dceb49b14a2bb280fda11c3ade33'), 'white', {renderer: 'canvas'});\n",
       "                var option_44e7dceb49b14a2bb280fda11c3ade33 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u83b7\\u5956\\u9605\\u8bfb\\u60c5\\u51b5\",\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                \"19.30\",\n",
       "                \"12.94\",\n",
       "                \"13.94\",\n",
       "                \"18.95\",\n",
       "                \"14.34\",\n",
       "                \"14.98\",\n",
       "                \"20.11\",\n",
       "                \"21.17\"\n",
       "            ],\n",
       "            \"showBackground\": false,\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u672c\\u4e13\\u4e1a\\u5e73\\u5747\\u9605\\u8bfb\\u60c5\\u51b5\",\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                \"11.28\",\n",
       "                \"12.12\",\n",
       "                \"9.38\",\n",
       "                \"11.46\",\n",
       "                \"8.99\",\n",
       "                \"10.21\",\n",
       "                \"11.76\",\n",
       "                \"14.88\"\n",
       "            ],\n",
       "            \"showBackground\": false,\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u672a\\u83b7\\u5956\\u9605\\u8bfb\\u60c5\\u51b5\",\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                \"9.62\",\n",
       "                \"11.89\",\n",
       "                \"8.40\",\n",
       "                \"8.81\",\n",
       "                \"7.71\",\n",
       "                \"9.20\",\n",
       "                \"9.76\",\n",
       "                \"12.77\"\n",
       "            ],\n",
       "            \"showBackground\": false,\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u603b\\u5e73\\u5747\\u9605\\u8bfb\\u60c5\\u51b5\",\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                \"12.36\",\n",
       "                \"12.36\",\n",
       "                \"12.36\",\n",
       "                \"12.36\",\n",
       "                \"12.36\",\n",
       "                \"12.36\",\n",
       "                \"12.36\",\n",
       "                \"12.36\"\n",
       "            ],\n",
       "            \"showBackground\": false,\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u83b7\\u5956\\u9605\\u8bfb\\u60c5\\u51b5\",\n",
       "                \"\\u672c\\u4e13\\u4e1a\\u5e73\\u5747\\u9605\\u8bfb\\u60c5\\u51b5\",\n",
       "                \"\\u672a\\u83b7\\u5956\\u9605\\u8bfb\\u60c5\\u51b5\",\n",
       "                \"\\u603b\\u5e73\\u5747\\u9605\\u8bfb\\u60c5\\u51b5\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u83b7\\u5956\\u9605\\u8bfb\\u60c5\\u51b5\": true,\n",
       "                \"\\u672c\\u4e13\\u4e1a\\u5e73\\u5747\\u9605\\u8bfb\\u60c5\\u51b5\": true,\n",
       "                \"\\u672a\\u83b7\\u5956\\u9605\\u8bfb\\u60c5\\u51b5\": true,\n",
       "                \"\\u603b\\u5e73\\u5747\\u9605\\u8bfb\\u60c5\\u51b5\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u901a\\u4fe1\\u5de5\\u7a0b\",\n",
       "                \"\\u8ba1\\u7b97\\u673a\\u79d1\\u5b66\",\n",
       "                \"\\u7535\\u4fe1\\u5de5\\u7a0b\",\n",
       "                \"\\u4fe1\\u606f\\u5de5\\u7a0b\",\n",
       "                \"\\u7535\\u5b50\\u5546\\u52a1\",\n",
       "                \"\\u7269\\u8054\\u7f51\\u5de5\\u7a0b\",\n",
       "                \"\\u8f6f\\u4ef6\\u5de5\\u7a0b\",\n",
       "                \"\\u7535\\u5b50\\u79d1\\u5b66\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"min\": \"6\",\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u9605\\u8bfb\\u60c5\\u51b5\\u5bf9\\u6bd4\\u56fe\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_44e7dceb49b14a2bb280fda11c3ade33.setOption(option_44e7dceb49b14a2bb280fda11c3ade33);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1cd7f351430>"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Bar\n",
    "from pyecharts.render import make_snapshot\n",
    "from snapshot_selenium import snapshot\n",
    "bar=(\n",
    "    Bar()\n",
    "    .add_xaxis(category_total)\n",
    "    .add_yaxis(\"获奖阅读情况\",averge_pe_get)\n",
    "    .add_yaxis(\"本专业平均阅读情况\",averge_pe_total)\n",
    "    .add_yaxis(\"未获奖阅读情况\",averge_pe_no)\n",
    "    .add_yaxis(\"总平均阅读情况\",all_category_pe)\n",
    "    .set_global_opts(title_opts=opts.TitleOpts(title=\"阅读情况对比图\"),yaxis_opts=opts.AxisOpts(\n",
    "\t                min_='6')\n",
    "                    )\n",
    ")\n",
    "bar.render('read_test.html')\n",
    "bar.render_notebook()\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
